/**
 * Copyright (c) 2013-2020, tanghailan  (tanghailan@88.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.math.BigDecimal;

/**
 * <b>TestBigDecimal.java</b></br>
 *
 * <pre></pre>
 *
 * @author tanghailan  tanghailan@88.com
 * @date 2021年03月27日 11:00:33
 * @since JDK 1.8
 */
public class TestBigDecimal {
    public static void main(String[] args) {
        String json = "[{\"mainBody\":\"哈哈\",\"account\":\"\",\"beginTime\":\"2021-03-30\",\"endTime\":\"2021-03-30\"},{\"mainBody\":\"test\",\"account\":\"\",\"beginTime\":\"2021-03-30\",\"endTime\":\"2021-03-30\"}]";
        JSONArray objects = JSONUtil.parseArray(json);

        for (int i = 0; i < objects.size(); i++) {
            JSONObject jsonObject = objects.getJSONObject(i);
            System.out.println(jsonObject.getStr("mainBody"));
        }

    }
}
